#include <iostream>
using namespace std;
class A
{
  //friend class B;
public:
    A() { ++_scount; }
	A(const A& t) { ++_scount; }
	~A() { --_scount; }
    //静态成员函数
	static int GetACount() { return _scount; }
private:
    class B{
      A *aa;
      public:
      B(int b = 0){
        //aa._a = a;
        //cout << aa._a << endl;
        _b = b;
        cout << _b << endl;
      }
      int _b;
    };
	//静态成员为所有类对象所共享，静态成员变量存放在静态区
    //静态成员变量的声明 
	static int _scount;
  int _a;
};
//静态成员变量必须在类外定义
int A::_scount = 0;


void TestA()
{
	cout << A::GetACount() << endl;
	A a1, a2;
	A a3(a1);
	cout << A::GetACount() << endl;
}

int main(){
  //cout << sizeof(A) << endl;
  //cout << A::GetACount() << endl;
  //cout << "-------------" << endl;
  //TestA();
  //cout << "-------------" << endl;
  //cout << A::GetACount() << endl;
  //B bb(10);
  A::B(12);
  
  return 0;
}
